package demo2;

public class Computer {
    public void openComputer() {
        System.out.println("打开电脑");
    }
    public void closeComputer() {
        System.out.println("关闭电脑");
    }
    public void useDevice(IUSB usb){
        usb.openDevice();
        usb.test1();
        if(usb instanceof Screen) {
            Screen screen = (Screen)usb;
            screen.show();
        }
        if (usb instanceof Keyborad keyborad){
            keyborad.inPut();
        }
        usb.closeDevice();
    }
}
